GtkMenuButton: Don't leak popovers
authorMatthias Clasen <mclasen@redhat.com>
Thu, 18 Dec 2014 03:56:30 +0000 (22:56 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 18 Dec 2014 03:56:30 +0000 (22:56 -0500)
Detach the previous popover from the toplevel when a new one
is set. This should fix

https://bugzilla.gnome.org/show_bug.cgi?id=741652

gtk/gtkmenubutton.c

index bc0f437cc9bc6456e753738058c98bd559456cc3..422c07fb99f569bd7e286261d166d111290b5541 100644 (file)
@@ -1167,6 +1167,8 @@ gtk_menu_button_set_popover (GtkMenuButton *menu_button,
       g_signal_handlers_disconnect_by_func (priv->popover,
                                             menu_deactivate_cb,
                                             menu_button);
+
+      gtk_popover_set_relative_to (GTK_POPOVER (priv->popover), NULL);
     }
 
   priv->popover = popover;